<#assign base=request.contextPath>
<!DOCTYPE html> 
<html>
<head>
    <title></title>
    <meta charset="utf-8">
		<#include "common/reference.ftl" />
		<#include "common/ligerui.ftl" />
    <script type="text/javascript">
        <!--
        var ligerTable = null;
        $(function(){
            $('.select-chosen').chosen();
            ligerTable = $('#table').ligerGrid({
                width:'98%',
                enabledSort:false,
                pageSizeOptions:[5,10,20,50,100,200],
                height:'auto',
                alternatingRow:true,
                url:'${base}/${route}/order/getList',
                delayLoad:false,
                columns:[
                    {display:'用户id',name:'uid',id:'uid',align:'center',minWidth:80},
                    {display:'订单内容（文字）',name:'orderWord',id:'orderWord',align:'center',minWidth:120},
                    {
                        display:'订单内容（语音）',
                        name:'orderVoice',
                        id:'orderVoice',
                        align:'center',
                        minWidth:150,
                        render:function(row){
                            if(row.orderVoice){
                                return '<a href="/media/'+row.orderVoice+'" target="_blank">'+row.orderVoice+'</a>';
                            }
                            return '';
                        }
                    },
                    {
                        display:'下单时间',
                        name:'orderTime',
                        id:'orderTime',
                        align:'center',
                        minWidth:150,
                        render:function(row){
                            if(row.orderTime > 0){
                                return formatDate(row.orderTime * 1000);
                            }
                            return '-';
                        }
                    },
                    {display:'下单手机号',name:'mobile',id:'mobile',align:'center',minWidth:100},
                    {display:'下单端口号',name:'port',id:'port',align:'center',minWidth:80},
                    {display:'下单IP',name:'ip',id:'ip',align:'center',minWidth:120},
                    {display:'下单MAC',name:'mac',id:'mac',align:'center',minWidth:120},
                    {display:'下单IMEI',name:'imsi',id:'imsi',align:'center',minWidth:120},
                    {display:'下单IMSI',name:'imei',id:'imei',align:'center',minWidth:120},
                    {display:'下单地址',name:'orderAddress',id:'orderAddress',align:'center',minWidth:150},
                    {display:'下单经度',name:'orderLongitude',id:'orderLongitude',align:'center',minWidth:80},
                    {display:'下单纬度',name:'orderLatitude',id:'orderLatitude',align:'center',minWidth:80},
                    {display:'租约车类型',name:'rentalType',id:'rentalType',align:'center',minWidth:80},
                    {
                        display:'预约上车时间',
                        name:'departTime',
                        id:'departTime',
                        align:'center',
                        minWidth:150,
                        render:function(row){
                            if(row.departTime > 0){
                                return formatDate(row.departTime * 1000);
                            }
                            return '-';
                        }
                    },
                    {display:'预约上车地址',name:'departure',id:'departure',align:'center',minWidth:150},
                    {display:'预约上车经度',name:'depLongitude',id:'depLongitude',align:'center',minWidth:80},
                    {display:'预约上车纬度',name:'depLatitude',id:'depLatitude',align:'center',minWidth:80},
                    {display:'预约下车地址',name:'destination',id:'destination',align:'center',minWidth:150},
                    {display:'预约下车经度',name:'destLongitude',id:'destLongitude',align:'center',minWidth:80},
                    {display:'预约下车纬度',name:'destLatitude',id:'destLatitude',align:'center',minWidth:80}
                ],
                onDblClickRow: function (data, rowindex, rowobj){
                    layer.open({
                        title:'${module}',
                        type:2,
                        maxmin:false,
                        area: ['100%', '100%'],
                        content:'${base}/${route}/order/view/'+data.id
                    });
                }
            });

            function reload(){
                if(ligerTable){
                    var searchKey = $('#txtSearchKey').val();
                    ligerTable.setParm('searchKey',searchKey);
                    ligerTable.reload();
                }
            }
            $('#btnSearch').click(function(){
                reload();
            })
            $('#btnEdit').click(function(){
                if(ligerTable){
                    var row = ligerTable.getSelectedRow();
                    if(!row || row.helpId < 1){
                        layer.msg('请选择行')
                        return;
                    }
                    var id = row.id;
                    var url='${base}/${route}/order/edit/'+id;
                    changePage(url);
                }
            });
            $('#btnRemove').click(function(){
                if(ligerTable){
                    var row = ligerTable.getSelectedRow();
                    if(!row || row.helpId < 1){
                        layer.msg('请选择行')
                        return;
                    }
                    var id = row.id;
                    layer.confirm('确定要删除吗？',function(){
                        $.ajax({
                            url:'${base}/${route}/order/remove/'+id,
                            type:'POST',
                            data:{},
                            dataType:'json',
                            success:function(rst){
                                layer.alert(rst.message);
                                if(rst.status=='OK' && ligerTable != null ){
                                    ligerTable.reload();
                                }
                            }
                        });
                    });
                }
            });
        });
        //-->
    </script>
</head>
<body class="$configs["skinName"]">
		<#include "common/breadcrumb.ftl">
<div class="widget-box">
    <div class="widget-header widget-header-flat">
        <h5 class="lighter">
            <i class="fa fa-search"></i>
        ${module}查询
        </h5>
    </div>
    <div class="widget-body">
        <div class="widget-main">
            <div class="row">
                <div class="col-xs-5 col-sm-5">
                    <div class="input-group">
                        <span class="input-group-addon">关键字</span>
                        <input id="txtSearchKey" type="text" class="form-control search-query" placeholder="请输入关键字搜索" />
                        <span class="input-group-btn">
									<button id="btnSearch" type="button" class="btn btn-primary btn-sm">
										查询
										<i class="fa fa-search bigger-110"></i>
									</button>
								</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="widget-box">
    <div class="widget-header">
        <h5 class="lighter">
            <i class="icon-table"></i>
        ${module}列表
        </h5>
        <!--非查询者有该操作-->
				<#if user?exists && viewerRole?exists && user.roleId != viewerRole>
                <!--
				<div class="widget-toolbar">
                    <button id="btnEdit" type="button" class="btn btn-primary btn-xs">
                        <i class="fa fa-check-square-o"></i>编辑
                    </button>
                    <button id="btnRemove" type="button" class="btn btn-primary btn-xs">
                        <i class="fa fa-trash-o"></i>删除
                    </button>
                </div>
                -->
                </#if>
    </div>
    <div class="widget-body">
        <div id="table"><div>
        </div>
        </div>
        </body>
</html>